#!/bin/bash
tmp_dir=$(mktemp -d -t ci-XXXXXXXXXX)

DATES=20200406-20200512
DATES=$(echo 2020{04{06..30},05{01..12}})
DATES="$DATES"
echo $DATES

horizon=3
thres=4.0
parallel -k "./bazel-bin/cc/appcoin2/experimental/donggu/strat --driver cc/appcoin2/experimental/donggu/strat/archive1.json --start {} --duration P1D --thres $thres --horizon $horizon --sim_result_filepath $tmp_dir/{}.pb 2>/dev/null" ::: $DATES

echo $tmp_dir

./pyrunner \
python/coin/pnl/sim_stat_frompb.py \
--pb_path "$tmp_dir/*.pb" \
--feed_machine "feed-05.ap-northeast-1.aws" \
--api_override=Spot:Huobi=v1.snapshot,Futures:Huobi=v1.incremental,Futures:Okex=v3.realtime,Futures:Binance=v1.l1_realtime \
--sim_result_dir out/exp \
--sim_result_prefix "horizon${horizon}thres${thres}" \
--use_feed_cache True \
1>/dev/null
